//
//  ZallPlaceholderTextViewCell.h
//  ZJS
//
//  Created by so on 16/9/1.
//  Copyright © 2016年 zall. All rights reserved.
//

#import "Foundation/Foundation.h"
#import "ZallBaseTableViewCell.h"

NS_ASSUME_NONNULL_BEGIN

@interface ZallPlaceholderTextView : UITextView

/**
 *  @brief  最大字数
 */
@property (assign, nonatomic) NSUInteger maxWordCount;

/**
 *  @brief  占位符
 */
@property (copy, nonatomic, nullable) NSString *placeholder;

/**
 *  @brief  占位符颜色
 */
@property (strong, nonatomic) UIColor *placeholderColor;

/**
 *  @brief  富文本占位符
 */
@property (copy, nonatomic, nullable) NSAttributedString *attributedPlaceholder;

/**
 *  @brief  复用调用
 */
- (void)prepareForReuse;

@end

/**
 *  @brief  代理协议前置声明
 */
@protocol ZallPlaceholderTextViewCellDelegate;


/**
 *  @brief  带输入框的单元格
 */
@interface ZallPlaceholderTextViewCell : ZallBaseTableViewCell

/**
 *  @brief  输入视图
 */
@property (strong, nonatomic, readonly) ZallPlaceholderTextView *textView;

/**
 *  @brief  代理
 */
@property (weak, nonatomic) id <ZallPlaceholderTextViewCellDelegate> delegate;

/**
 *  @brief  大小
 */
- (CGSize)contentSize;

@end

/**
 *  @brief  代理协议的声明
 */
@protocol ZallPlaceholderTextViewCellDelegate <NSObject>
/**
 *  @brief  大小发生变化时的回调
 */
- (void)placeholderTextViewCell:(ZallPlaceholderTextViewCell *)cell contentSizeDidChanged:(CGSize)contentSize;
@end

NS_ASSUME_NONNULL_END
